package router

import (
	"github.com/gin-gonic/gin"
	"mxshop_api/goods_web/api/brands"
	"mxshop_api/goods_web/middlewares"
)

func BrandsRouter(group *gin.RouterGroup) {
	BrandsRouter := group.Group("brands").Use(middlewares.JWTAuth())
	{
		BrandsRouter.GET("", brands.BrandList)
		BrandsRouter.POST("", brands.NewBrand)
		BrandsRouter.PUT("/:id", brands.UpdateBrand)
		BrandsRouter.DELETE("/:id", brands.DeleteBrand)
	}

	CategoryBrandRouter := group.Group("categorybrands")
	{
		CategoryBrandRouter.GET("", brands.CategoryBrandList)          // 类别品牌列表页
		CategoryBrandRouter.DELETE("/:id", brands.DeleteCategoryBrand) // 删除类别品牌
		CategoryBrandRouter.POST("", brands.NewCategoryBrand)          //新建类别品牌
		CategoryBrandRouter.PUT("/:id", brands.UpdateCategoryBrand)    //修改类别品牌
		CategoryBrandRouter.GET("/:id", brands.GetCategoryBrandList)   //获取分类的品牌
	}
}